/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.smarttmt.smartmanager.entity;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author nicolas
 */
@Entity
@Table(name = "ESTRCHEQ")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Estrcheq.findAll", query = "SELECT e FROM Estrcheq e"),
    @NamedQuery(name = "Estrcheq.findByEschcodi", query = "SELECT e FROM Estrcheq e WHERE e.eschcodi = :eschcodi"),
    @NamedQuery(name = "Estrcheq.findByEschnomb", query = "SELECT e FROM Estrcheq e WHERE e.eschnomb = :eschnomb"),
    @NamedQuery(name = "Estrcheq.findByEschfech", query = "SELECT e FROM Estrcheq e WHERE e.eschfech = :eschfech"),
    @NamedQuery(name = "Estrcheq.findByEschtipo", query = "SELECT e FROM Estrcheq e WHERE e.eschtipo = :eschtipo"),
    @NamedQuery(name = "Estrcheq.findByEschvweb", query = "SELECT e FROM Estrcheq e WHERE e.eschvweb = :eschvweb")})
public class Estrcheq implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 4)
    @Column(name = "ESCHCODI")
    private String eschcodi;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "ESCHNOMB")
    private String eschnomb;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ESCHFECH")
    @Temporal(TemporalType.TIMESTAMP)
    private Date eschfech;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "ESCHTIPO")
    private String eschtipo;
    @Column(name = "ESCHVWEB")
    private BigInteger eschvweb;
    @OneToMany(mappedBy = "actilich", fetch = FetchType.LAZY)
    private List<Activida> actividaList;

    public Estrcheq() {
    }

    public Estrcheq(String eschcodi) {
        this.eschcodi = eschcodi;
    }

    public Estrcheq(String eschcodi, String eschnomb, Date eschfech, String eschtipo) {
        this.eschcodi = eschcodi;
        this.eschnomb = eschnomb;
        this.eschfech = eschfech;
        this.eschtipo = eschtipo;
    }

    public String getEschcodi() {
        return eschcodi;
    }

    public void setEschcodi(String eschcodi) {
        this.eschcodi = eschcodi;
    }

    public String getEschnomb() {
        return eschnomb;
    }

    public void setEschnomb(String eschnomb) {
        this.eschnomb = eschnomb;
    }

    public Date getEschfech() {
        return eschfech;
    }

    public void setEschfech(Date eschfech) {
        this.eschfech = eschfech;
    }

    public String getEschtipo() {
        return eschtipo;
    }

    public void setEschtipo(String eschtipo) {
        this.eschtipo = eschtipo;
    }

    public BigInteger getEschvweb() {
        return eschvweb;
    }

    public void setEschvweb(BigInteger eschvweb) {
        this.eschvweb = eschvweb;
    }

    @XmlTransient
    public List<Activida> getActividaList() {
        return actividaList;
    }

    public void setActividaList(List<Activida> actividaList) {
        this.actividaList = actividaList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (eschcodi != null ? eschcodi.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Estrcheq)) {
            return false;
        }
        Estrcheq other = (Estrcheq) object;
        if ((this.eschcodi == null && other.eschcodi != null) || (this.eschcodi != null && !this.eschcodi.equals(other.eschcodi))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.smarttmt.smartmanager.entity.Estrcheq[ eschcodi=" + eschcodi + " ]";
    }
    
}
